import QtQuick 2.0

Row {
    y: 300
    spacing: 30

    AnimationImageV1 {
        id: ufo
        text: "Parallel Animation"
        onClicked: anim.restart()
        // 并行执行动画
        ParallelAnimation {
            id: anim
            NumberAnimation {
                target: ufo
                property: "y"
                to: -280
                duration: 2000
                easing.type: Easing.InOutQuad
            }
            NumberAnimation {
                target: ufo
                property: "rotation"
                to: 360
                duration: 2000
                easing.type: Easing.InOutQuad
            }
        }
    }
    AnimationImageV1 {
        id: ufo2
        text: "Sequential Animation"
        onClicked: seq_anim.restart()
        // 队列执行动画
        SequentialAnimation {
            id: seq_anim
            NumberAnimation {
                target: ufo2
                property: "y"
                to: -280
                duration: 2000
                easing.type: Easing.InOutQuad
            }
            NumberAnimation {
                target: ufo2
                property: "rotation"
                to: 360
                duration: 2000
                easing.type: Easing.InOutQuad
            }
        }
    }
}
